Function.prototype.bind = function (oThis) {
  if (typeof this !== 'function') return
  const initArgs = Array.prototype.slice.call(arguments, 1)
  const self = this
  function fNop() {}
  function fBound() {
    const args = initArgs.concat(Array.prototype.slice.call(arguments))
    const realThis = this instanceof fNop ? this : oThis
    return self.apply(realThis, args)
  }
  fBound.prototype = new fNop()
  return fBound
}
